<template>
  <view class="box">
    <!-- 我的喜好 -->
    <view class="tou top" :style="'padding-top:' + statusBarHeight1 + 'px'">
      <image
        @click="fanhui"
        class="image1"
        src="https://pic.bangbangtongcheng.com/static/fanhui_bai.png"
      />
    </view>
    <view class="center">
      <view class="tips">请选择房源类型：</view>
      <view class="tabel">
        <view class="item" @click="tz(0)">
          <text class="item_text">住宅</text>
          <image
            class="item_image"
            src="https://pic.bangbangtongcheng.com/static/bbzc/yitoudijianli.png"
            mode=""
          ></image>
        </view>
        <view class="item" @click="tz(1)">
          <text class="item_text">商铺</text>
          <image
            class="item_image"
            src="https://pic.bangbangtongcheng.com/static/bbzc/yitoudijianli.png"
            mode=""
          ></image>
        </view>
        <view class="item" @click="tz(2)">
          <text class="item_text">写字楼</text>
          <image
            class="item_image"
            src="https://pic.bangbangtongcheng.com/static/bbzc/yitoudijianli.png"
            mode=""
          ></image>
        </view>
        <view class="item" @click="tz(3)">
          <text class="item_text">厂房</text>
          <image
            class="item_image"
            src="https://pic.bangbangtongcheng.com/static/bbzc/yitoudijianli.png"
            mode=""
          ></image>
        </view>
        <view class="item" @click="tz(4)">
          <text class="item_text">土地</text>
          <image
            class="item_image"
            src="https://pic.bangbangtongcheng.com/static/bbzc/yitoudijianli.png"
            mode=""
          ></image>
        </view>
        <view class="item" @click="tz(5)">
          <text class="item_text">车位</text>
          <image
            class="item_image"
            src="https://pic.bangbangtongcheng.com/static/bbzc/yitoudijianli.png"
            mode=""
          ></image>
        </view>
      </view>
    </view>
    <uniBall></uniBall>
  </view>
</template>
<script>
import { mapGetters } from "vuex";
let statusBarHeight;
//#ifdef H5
import wxshare from "../../utils/index.js";
statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 10;
//#endif
// #ifdef APP-PLUS
statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 10;
//  #endif
// #ifdef MP-WEIXIN
statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 5;
//  #endif
export default {
  data() {
    return {
      statusBarHeight,
      userInfo: uni.getStorageSync("Pduser"),
      fromType: null,
    };
  },
  computed: {
    ...mapGetters(["statusBarHeight1", "userinfo"]),
  },
  onLoad(opt) {
    opt.fromType && (this.fromType = opt.fromType);
    /* #ifdef H5 */
    this.jinzhi();
    /* #endif */
  },
  methods: {
    fanhui() {
      uni.navigateBack({
        delta: 1,
      });
    },
    tz(type) {
      if (this.fromType) {
        uni.redirectTo({
          url: "/pages_release/tenement?type=" + type,
        });
      } else {
        uni.redirectTo({
          url: "/pages_release/index?type=" + type,
        });
      }
    },
    jinzhi() {
      let _this = this;
      let param = window.location.href.split("#")[0];
      uni.request({
        method: "post",
        data: {
          url: param,
        },
        header: {
          "content-type": "application/x-www-form-urlencoded",
        },
        url: "https://www.bangbangtongcheng.com/conven//mob/login/getJsTicket.do",
        success(re) {
          _this.jinzhifx(re.data);
        },
      });
    },
    jinzhifx(data) {
      wxshare.config({
        debug: false, //是否打开调试
        appId: data.appId, // 公众号的唯一标识
        timestamp: data.timestamp, // 生成签名的时间戳
        nonceStr: data.nonce, // ，生成签名的随机串
        signature: data.signature, // 签名
        jsApiList: ["hideMenuItems"],
      });
      // 禁止分享
      wxshare.hideMenuItems({
        // 要隐藏的菜单项，只能隐藏“传播类”和“保护类”按钮，所有menu项见附录3
        menuList: [
          "menuItem:share:appMessage",
          "menuItem:share:timeline",
          "menuItem:share:timeline",
          "menuItem:share:qq",
          "menuItem:favorite",
          "menuItem:share:QZone",
          "menuItem:openWithSafari",
        ],
      });
    },
  },
};
</script>
<style lang="less" scoped>
.box {
  width: 100%;
  min-height: 100vh;
  background-color: #fff;
}
.tou {
  position: relative;
  width: 100%;
  text-align: center;
  /* #ifdef MP-WEIXIN */
  text-align: left;
  display: flex;
  align-items: center;
  /* #endif */
  line-height: 88rpx;
  font-size: 36rpx;
  color: #fff;
  background-color: #64b6a8;

  .image1 {
    position: absolute;
    width: 32rpx;
    height: 32rpx;
    left: 30rpx;
  }

  .p2 {
    position: absolute;
    bottom: 0rpx !important;
    right: 30rpx;
    /* #ifdef MP-WEIXIN */
    position: initial;
    margin-left: auto;
    margin-right: 200rpx;
    bottom: 16rpx !important;
    /* #endif */
  }
}
.center {
  padding: 30rpx 40rpx 0 40rpx;
  .tips {
    font-size: 28rpx;
    font-weight: 400;
    color: #64b6a8;
    margin-bottom: 40rpx;
    margin-left: 10rpx;
  }
  .tabel {
    display: flex;
    flex-direction: column;
    .item {
      height: 120rpx;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid #e0e0e0;
      padding: 0 20rpx;
      .item_text {
        font-size: 34rpx;
        font-weight: 400;
        color: #000000;
      }
      .item_image {
        width: 36rpx;
        height: 36rpx;
      }
    }
  }
}
</style>
